<?xml version="1.0" encoding="UTF-8" ?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

<#--
 *  Copyright (c) 2004 The Open For Business Project - www.ofbiz.org
 *
 *  Permission is hereby granted, free of charge, to any person obtaining a 
 *  copy of this software and associated documentation files (the "Software"), 
 *  to deal in the Software without restriction, including without limitation 
 *  the rights to use, copy, modify, merge, publish, distribute, sublicense, 
 *  and/or sell copies of the Software, and to permit persons to whom the 
 *  Software is furnished to do so, subject to the following conditions:
 *
 *  The above copyright notice and this permission notice shall be included 
 *  in all copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
 *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
 *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
 *  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 
 *  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 
 *  OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 
 *  THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 *@author     Leon Torres (leon@opensourcestrategies.com)
 *@version    $Rev: 418498 $
 *@since      3.2
-->

<#-- do not display columns associated with values specified in the request, ie constraint values -->

<fo:layout-master-set>
    <fo:simple-page-master master-name="main" page-height="11in" page-width="8.5in" margin-top="0.5in" margin-bottom="1in" margin-left="1in" margin-right="1in">
        <fo:region-body margin-top="1in"/>
        <fo:region-before extent="1in"/>
        <fo:region-after extent="1in"/>
    </fo:simple-page-master>
</fo:layout-master-set>
  <#assign prevYear = null>
  <#list meetingList?sort_by('datetimeStarted') as meeting>
      <#assign thisYear = meeting.datetimeStarted?string("yyyy")>
      <#-- If we need to start a new page, end the old one, but not at the very begining -->
      <#if prevYear !=null && thisYear !=prevYear>
        </fo:flow>
        </fo:page-sequence>
      </#if>
      <#if thisYear != prevYear>
        <fo:page-sequence master-reference="main">
            <fo:static-content flow-name="xsl-region-before" font-family="Helvetica">
                <fo:block font-size="14pt">
                    <fo:external-graphic src="url('http://aycu08.webshots.com/image/3407/1431549912123450904_rs.jpg')"/>
                </fo:block>
            </fo:static-content>
            <fo:static-content flow-name="xsl-region-after" font-family="Helvetica">
                <fo:block font-size="8pt">
                  <fo:list-block padding-before="6pt">
                    <fo:list-item>
                      <fo:list-item-label end-indent="3in" font-size="10pt">
                            <#assign nowTimestamp = Static["org.ofbiz.base.util.UtilDateTime"].nowTimestamp()>
                            <fo:block text-align="start" font-size="10pt">Generated: ${nowTimestamp?string("MMM dd, yyyy")}</fo:block>
                      </fo:list-item-label>
                      <fo:list-item-body start-indent="3in">
                            <fo:block text-align="end" font-size="10pt">Document Version: 1.0</fo:block>
                      </fo:list-item-body>
                    </fo:list-item>
                  </fo:list-block>
                </fo:block>
            </fo:static-content>
            <fo:flow flow-name="xsl-region-body" 
                 font-family="Helvetica">
              <fo:block font-size="14pt"
                  font-weight="bold">
                ${thisYear?if_exists}
              </fo:block>
      </#if>
			  <fo:block text-align="left" font-size="10pt">
			    <fo:list-block border-bottom="1pt gray ridge" padding-after="6pt" padding-top="20px">
			        <fo:list-item>
			            <fo:list-item-label end-indent="3in"font-size="10pt">
			                <fo:block text-align="start" font-size="14pt">${meeting.datetimeStarted?string("MMM dd, yyyy")} </fo:block>
            			</fo:list-item-label>
			            <fo:list-item-body start-indent="0in">
			                <fo:block text-align="end" font-size="14pt">${meeting.subject?if_exists} - ${meeting.length?if_exists} minutes</fo:block>
			            </fo:list-item-body>
			        </fo:list-item>
			    </fo:list-block>
			  </fo:block>
              <#assign prevYear = thisYear>
      <#if !meeting_has_next>
            </fo:flow>
        </fo:page-sequence>
      </#if>
  </#list>
</fo:root>
